/**
 * Created by lee on 2017/7/2.
 */
/*点击页面添加按钮执行addStudent()方法*/
$("#addBtn").click(function() {
    addStudent();
});
/*定义addStudent()方法*/
function addStudent(){
    $.ajax({
        type: "POST",
        dataType: "json",
        url: "rest/student/add",
        data: {
            studentName: $("#studentName").val(),
            studentAge: $("#studentAge").val(),
            studentCity: $("#studentCity").val(),
        },
        success: function() {
            window.location.href="rest/student/listStudent";  //跳转到列表页面
        }

    });
}

